import React, {Component} from 'react';

import {Provider} from 'react-redux';
import {Theme} from 'teaset';

import store from './app/store/store';
import {AppNavigator} from './app/navigator/navigtion';
import * as TYPES from './app/common/type'
import teastTheme from './scripts/teastTheme'


Theme.set(teastTheme);

if (!__DEV__) {
    global.console = {
        info: () => {
        },
        log: () => {
        },
        warn: () => {
        },
        debug: () => {
        },
        error: () => {
        },
    };
}


export default class App extends Component {


    componentWillUnmount() {
        store.dispatch({
            type: TYPES.UNINITIAL_APP
        })
    }

    render() {
        return (
            <Provider store={store}>
                <AppNavigator/>
            </Provider>
        );
    }

}

